<script setup lang="ts">
import {onMounted, ref} from "vue";
import {getSubject} from "@/api/subject"

let subjectTableData = ref([]);

onMounted(() => {
  getSubjectTableData()
})

const getSubjectTableData = async () => {
  let result = await getSubject()
  if (result.code == "20000") {
    subjectTableData.value = result.data
  }
}

</script>

<template>
  <div class="table_content">
    <el-table :data="subjectTableData" stripe style="width: 100%">
      <el-table-column prop="subjectId" label="subjectId"/>
      <el-table-column prop="subjectTitle" label="subjectTitle" width="180"/>
      <el-table-column prop="subjectContent" label="subjectContent" width="180"/>
    </el-table>
  </div>
</template>

<style scoped lang="scss">
.table_content {
  width: 80%;
}
</style>
